package com.lmt.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Date 2018/07/03
 *
 * @author MT-Lin
 */
@RestController
public class ConfigClientController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    /**
     * 绑定Git仓库配置文件中的profile属性
     */
    @Value("${profile}")
    private String profile;

    /**
     * 绑定Git仓库配置文件中的file-relative-path属性
     */
    @Value("${file-relative-path}")
    private String fileRelativePath;

    @GetMapping("/getConfig")
    public String getConfig(){
        String config = "profile:" +
                profile +
                "       file-relative-path:" +
                fileRelativePath;
        logger.warn("service-config-client->getConfig:return String {}", config);
        return config;
    }
}
